home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / kernel / copying.awk < prev    next >
Encoding:
AWK Script  |  1996-07-07  |  1.1 KB  |  48 lines  |  [TEXT/R*ch]

  1. BEGIN    {
  2.       FS="\"";
  3.       print "/* ==> Do not modify this file!!  It is created automatically";
  4.       print "   by copying.awk.  Modify copying.awk instead.  <== */";
  5.       print ""
  6.       print "#include \"conq.h\""
  7.       print ""
  8.       print "void";
  9.       print "describe_copyright(arg, key, buf)";
  10.       print "int arg;";
  11.       print "char *key, *buf;";
  12.       print "{";
  13.     }
  14. NR == 1,/^[     ]*NO WARRANTY[     ]*$/    {
  15.       if ($0 ~ / /)
  16.         {
  17.           printf "  tprintf(buf, \"\\n\");\n";
  18.         }
  19.       else if ($0 !~ /^[     ]*NO WARRANTY[     ]*$/) 
  20.         {
  21.           printf "  tprintf(buf, \"";
  22.           for (i = 1; i < NF; i++)
  23.         printf "%s\\\"", $i;
  24.           printf "%s\\n\");\n", $NF;
  25.         }
  26.     }
  27. /^[     ]*NO WARRANTY[     ]*$/    {
  28.       print "}";
  29.       print "";
  30.       print "void";
  31.       print "describe_warranty(arg, key, buf)";
  32.       print "int arg;";
  33.       print "char *key, *buf;";
  34.       print "{";
  35.     }
  36. /^[     ]*NO WARRANTY[     ]*$/, /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/{  
  37.       if (! ($0 ~ /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/)) 
  38.         {
  39.           printf "  tprintf(buf, \"";
  40.           for (i = 1; i < NF; i++)
  41.         printf "%s\\\"", $i;
  42.           printf "%s\\n\");\n", $NF;
  43.         }
  44.     }
  45. END    {
  46.       print "}";
  47.     }
  48.